<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <head>
        <th:block th:include="include::header('表单设计')" />
    </head>
    <body class="febs-container" id="febs-formDesign">
        <div class="febs-body layui-fluid"  lay-title="表单设计" >
            <div class="febs-body-search">
                <form class="jhg-body layui-form layui-table-form" lay-filter="formDesign-table-form" id="formDesign-table-form">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-form-item">
                                <div class="layui-inline" id="baseArea-tenant" th:classappend="${hasHeadCompanyRole } ? '' : 'febs-hide'">
                                    <label class="layui-form-label layui-form-label-sm">公司名称</label>
                                    <div class="layui-input-inline" >
                                        <select name="tenantId" id="tenantId" lay-search="" >
                                            <option th:each="item:${tenantList }"
                                                    th:value="${item.tenantId}" th:text="${item.tenantName}"
                                                    th:selected="${tenantId ==item.tenantId}">
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">表单名称</label>
                                    <div class="layui-input-inline" style="width:190px;">
                                        <input type="text" name="formName" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">日期范围</label>
                                    <div class="layui-input-inline" id="laydate-range">
                                        <input type="text" name="startDate" autocomplete="off" id="startDate" lay-verify="date"
                                               class="layui-input" placeholder="开始日期">
                                    </div>
                                    <div class="layui-form-mid">-</div>
                                    <div class="layui-input-inline">
                                        <input type="text" name="endDate" autocomplete="off" id="endDate" lay-verify="date"
                                               class="layui-input" placeholder="结束日期">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">状态</label>
                                    <div class="layui-input-inline" style="width:190px;">
                                        <select name="status" id="status">
                                            <option value="">请选择</option>
                                            <option value="1">待发布</option>
                                            <option value="2">已发布</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <div id="query" class="layui-btn">
                                        <em class="layui-icon">&#xe615;</em> 查询
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="febs-table-full">
                <table lay-filter="formDesignTable" id="formDesignTable'}" lay-data="{id: 'formDesignTable'}"></table>
            </div>
        </div>
        <th:block th:include="include::foot" />
        <script type="text/html" id="formDesign-toolbar">
            <div lay-event="add" class="layui-btn layui-btn-sm" shiro:hasPermission="formDesign:add">
                <em class="layui-icon">&#xe654;</em> 新增
            </div>
        </script>
        <script type="text/html" id="formDesign-tool">
            <span shiro:lacksPermission="formDesign:edit,formDesign:delete">
                <span class="layui-badge-dot febs-bg-orange"></span> 无权限
             </span>
            {{# if((d.status==1)) { }}
            <button shiro:hasPermission="formDesign:edit" type="button" class="layui-btn layui-btn-xs layui-btn-primary layui-border-orange" lay-event="edit">
                <i class="layui-icon layui-icon-edit"></i>编辑</button>
            <button shiro:hasPermission="formDesign:delete" type="button" class="layui-btn layui-btn-xs layui-btn-primary layui-border-red" lay-event="del">
                <i class="layui-icon layui-icon-delete"></i>删除</button>
            {{# }else { }}
            <button shiro:hasPermission="formDesign:edit" type="button" class="layui-btn layui-btn-xs layui-btn-primary layui-border-orange layui-btn-disabled" lay-event="edit" disabled>
                <i class="layui-icon layui-icon-edit"></i>编辑</button>
            <button shiro:hasPermission="formDesign:delete" type="button" class="layui-btn layui-btn-xs layui-btn-primary layui-border-red layui-btn-disabled" lay-event="del" disabled>
                <i class="layui-icon layui-icon-delete"></i>删除</button>
            {{# }}}
        </script>
        <script th:src="@{/febs/js/formDesign/formDesignList.js(v=1)}"></script>
        <script type="text/html" id="templateFlgOption">
            <input type="checkbox" name="templateFlgOption" value="{{d.templateFlg}}" lay-skin="switch" lay-text="是|否"
                   lay-filter="templateFlgOption" lay-event="templateFlgEvent"  {{ d.templateFlg == '1' ? 'checked' : '' }} />
        </script>
        <script type="text/html" id="statusOption">
            <input type="checkbox" name="statusOption" value="{{d.status}}" lay-skin="switch" lay-text="发布|未发布"
                   lay-filter="statusOption" lay-event="statusEvent"  {{ d.status == '2' ? 'checked' : '' }} />
        </script>
        <script data-th-inline="javascript">
            var hasHeadCompanyRole = [[${hasHeadCompanyRole}]];
        </script>
    </body>
</html>